{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    {include file='goods/goods_brand/form' /}
    <div class="cl pd-5 bg-1 bk-gray">
    	<span class="l">
            {tp:menu menu='add,recyclebin,delete'/}
        </span>
        <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$count}</strong> 条
        </span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>
        <tr class="text-c">
            {include file="goods/goods_brand/th" /}
            <th width="70">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            {include file="goods/goods_brand/td" /}
            <td class="f-14">
            	{if($vo.apply==0)}
                {tp:access action='audit'}
                    	<a href="javascript:;" class="label label-success radius" onclick="audit_class({$vo.id})">通过</a>
                {/tp:access}
            	{/if}
                {tp:menu menu='sedit,sdelete' /}
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page-bootstrap">{$list->render()}</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
function audit_class(id){
	url = "auditOK";
	data = {id:id};
	layer.confirm('审核通过吗？', {
        btn: ['确定', '取消'],
        title: '提示',
        icon: 3
    }, function () {
        $.post(url, data, function (result) {
            if (result.code == 0) {
            	parent.layer.msg(result.msg, {icon: 1, time: 2000});
                //$(obj).parents("tr").fadeOut();
                location.reload();
            } else {
                layer.alert(result.msg);
            }
            fn && fn(data);
        }, 'json')
    }, function (index) {
        layer.close(index);
    });
}
</script>
{/block}
